home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 8
/
Amoszine 8 (Disk 2 of 3).adf
/
Powerbobs.lha
/
powerbobsv1.0
/
examples
/
amal_psprites.asc
< prev
next >
Wrap
Text File
|
1995-07-04
|
2KB
|
94 lines
Screen Open 0,320,200,16,L
Load "df0:examples/demo.abk"
Hide On
'
'Set up some simple Sprite images...
'
For I=1 To 7
Cls 0
Circle 8,8,I
Get Sprite I,0,0 To 16,16
Next
'We are only using 16 Psprites, so set the maximum to 16.
'This will save some time, specially on 68000 based machines.
'
Psprite Max 16
'We've grabbed 16 colours circles, so set the Psprite engine in 16 colour
'mode.
'
Set Psprite Colours 16
'
'Convert the grabbed Sprites in bank 1 from normal format
'to interleaved bitmap format.
'
Convert Sprites 1
Unpack 10 To 0
'
'It is very important to set the normal Bob and Sprite updates to Off !
'
Update Off
'
'Don't bother about the AMAL setup, just for testing...
'
For I=0 To 14 Step 2
A$="Let X=Z(120)+148;Let Y=Z(100)+Z(50)+50;Let R0=-1;Let R1=-1;Let A=Z(4)+2;"
A$=A$+"Loop: P ;P;"
A$=A$+"Let X=X+R0 ;"
A$=A$+"If X>398 Jump Reset ;"
A$=A$+"If X<148 Jump Reset ;"
A$=A$+"Let A=A+R1;"
A$=A$+"If A<2 Jump Image;"
A$=A$+"If A>6 Jump Image;"
A$=A$+"Jump Loop ;"
A$=A$+"Reset: ;"
A$=A$+"Let R0=R0*-1 ;"
A$=A$+"Jump Loop ;"
A$=A$+"Image: ;"
A$=A$+"Let R1=R1*-1 ;"
A$=A$+"Jump Loop ;"
Amal I,A$
Next
For I=1 To 15 Step 2
A$="Let X=Z(220)+Z(15)+148; Let Y=Z(160)+Z(10)+50;Let R0=1;Let R1=1;Let A=Z(4)+2;"
A$=A$+"Loop: P ;P;"
A$=A$+"Let X=X+R0 ;"
A$=A$+"If X>398 Jump Reset ;"
A$=A$+"If X<148 Jump Reset ;"
A$=A$+"Let A=A+R1;"
A$=A$+"If A<2 Jump Image;"
A$=A$+"If A>6 Jump Image;"
A$=A$+"Jump Loop ;"
A$=A$+"Reset: ;"
A$=A$+"Let R0=R0*-1 ;"
A$=A$+"Jump Loop ;"
A$=A$+"Image: ;"
A$=A$+"Let R1=R1*-1 ;"
A$=A$+"Jump Loop ;"
Amal I,A$
Next
'
'Assign the Psprites to an Amal channel...
'
For I=0 To 15
Pchannel To Psprite I To I
Next
'
'Let's go !
'
Amal On
Multi No
R=Execall(-132)
' Whe use 2 Pause instructions in the Amal progs, so synchronize it to
' the same speed.
Psync Every 2
Repeat
' Ok transfer the X/Y and A values to the Psprites and Update them on screen.
'
Psync Psprite 0 To 15
Wait Vbl
Until Left Click
R=Execall(-138)
Multi Yes
Erase 1
Erase 10